
#include	"SysConfig.h"
#include	"Define.h"
#include	"Function.h"
#include	"Display.h"
#ifdef  ST7565P
#include	"ST7565P.h"
#endif

#ifdef  LC786XXX
#include	"LC786XXX.h"
#endif

#ifdef  CD
#include	"CD_MECHA.h"
#include	"CD.h"
#endif
#ifdef  MIC
#include	"MIC.h"
#endif

#ifdef  CD
extern CD_DISC_TYPE  ucCD_CurrentPlayDiscType;
extern CD_STATUS	ucCD_Status;
extern UI_INFO_MODE		ucCD_Display_Info;
extern UI_ID3TAG_MODE	ucCD_Display_ID3Tag;
extern UI_CD_TEXT_MODE ucCD_Display_CD_Text;	
extern unsigned char	ucCD_FileName[MEDIA_CHAR_SIZE];
extern unsigned char	ucCD_FileName_CharCode;
extern unsigned char	ucCD_FolderName[MEDIA_CHAR_SIZE];
extern unsigned char	ucCD_FolderName_CharCode;
extern unsigned char	ucCD_ID3_Title[MEDIA_CHAR_SIZE];
extern unsigned char	ucCD_ID3_Title_CharCode;
extern unsigned char	ucCD_ID3_Artist[MEDIA_CHAR_SIZE];
extern unsigned char	ucCD_ID3_Artist_CharCode;
extern unsigned char	ucCD_ID3_Album[MEDIA_CHAR_SIZE];
extern unsigned char	ucCD_ID3_Album_CharCode;
extern unsigned char ucCD_ID3_AlbumArtist[MEDIA_CHAR_SIZE];
extern unsigned char ucCD_ID3_AlbumArtist_CharCode;

#ifdef  FILE_SEARCH
extern unsigned char	ucCD_FileSearchName[MEDIA_CHAR_SIZE];
extern unsigned char	ucCD_FileSearchName_CharCode;
#endif

extern unsigned char	ucCD_Pause;
extern UI_SCAN_MODE		ucCD_Scan;
extern UI_REPEAT_MODE	ucCD_Repeat;
extern UI_RANDOM_MODE	ucCD_Random;
extern UI_PLAY_INFO		sCD_PlayInfo;
extern unsigned char ucCD_FastPlay;
extern unsigned char ucDECK_User_Loading;

extern unsigned char  ucDECK_Mode;
extern unsigned char ucDISP_FolderName;
extern unsigned char ucDISP_FileName;
extern unsigned char	ucDISP_FolderName_Timer50msec;
extern unsigned char	ucDISP_FileName_Timer50msec;
extern unsigned char ucDISP_ScrollEnable;

#ifdef  LC78696X
extern LC786X_MEDIA_ID  ucLC786XXX_CurrentMediaID;
extern unsigned char	ucLC786XXX_InitializeComplete;
extern unsigned char 	ucLC786XXX_ErrorSeq;
#endif

extern unsigned char  CD_GetTextStatus(unsigned char ucDes);
extern unsigned char DISP_PageScroll(unsigned char ucOpt, UI_INFO_MODE ucMode,unsigned char * ucData,unsigned char ucSize,unsigned char ucUni);
extern LC786X_FORMAT	ucLC786X_FileFormat_CD;
extern unsigned char	ucDISP_ClockMode;
extern unsigned char	ucDISP_CurrentDisplay_Timer50msec;
extern unsigned char	usDISP_TempDispMode_Timer50msec;
extern UI_DISP ucDISP_TempDispMode;
extern unsigned char ucDISP_Blink;

void CD_DISP_IconMain(void)
{
	if  (ucLC786X_FileFormat_CD == LC786X_FORMAT_WMA)
	{
		DISP_IconSetStatusFlag(1, ICON_MASK_WMA);
	}

	if  ((ucLC786X_FileFormat_CD == LC786X_FORMAT_MPEG1_LAYER3) 
	||  (ucLC786X_FileFormat_CD == LC786X_FORMAT_MPEG2_LAYER3)
	||  (ucLC786X_FileFormat_CD == LC786X_FORMAT_MPEG25_LAYER3))
	{
		DISP_IconSetStatusFlag(1, ICON_MASK_MP3);
	}

	if  (ucDISP_TempDispMode == DISP_FILE_SEARCH)
	{
		DISP_IconSetStatusFlag(1, ICON_MASK_SCH);
	}
	
	switch  (ucCD_Random)
	{
		case RANDOM_ALL:
			DISP_IconSetStatusFlag(1, ICON_MASK_RDM);
			break;
		case RANDOM_FOLDER:
			DISP_IconSetStatusFlag(1, (ICON_MASK_RDM | ICON_MASK_DIR));
			break;
		case RANDOM_NONE:
			break;
	}

	switch  (ucCD_Repeat)
	{
		case REPEAT_FILE:
			DISP_IconSetStatusFlag(1, ICON_MASK_RPT);
			break;
		case REPEAT_FOLDER:
			DISP_IconSetStatusFlag(1, (ICON_MASK_RPT | ICON_MASK_DIR));
			break;
		case REPEAT_NONE:
			break;			
	}

	switch  (ucCD_Scan)
	{
		case SCAN_ALL:
			DISP_IconSetStatusFlag(1, ICON_MASK_INT);
			break;
		case SCAN_FOLDER:
			DISP_IconSetStatusFlag(1, (ICON_MASK_INT | ICON_MASK_DIR));
			break;
		case SCAN_NONE:
			break;
	}
	
}

void CD_DISP_Pause(void)
{
	unsigned char ucBuf[5];
	
	if  (ucDISP_Blink == 1)
	{
		return;
	}
	
	memcpy(&ucBuf[0], "PAUSE", 5);
				
	#ifdef  ST7565P
	ST7565_UpdateDisplayData(14, ucBuf[0]);
	ST7565_UpdateDisplayData(23, ucBuf[1]);
	ST7565_UpdateDisplayData(34, ucBuf[2]);
	ST7565_UpdateDisplayData(43, ucBuf[3]);
	ST7565_UpdateDisplayData(52, ucBuf[4]);
	#endif                       
}

void CD_DISP_CDError01(void)
{
	unsigned char ucBuf[8];
	unsigned char ucTemp;
	
	// ucTemp = Need  ErrorNumber Save

	ucBuf[6] = (ucTemp / 10) | '0';
	ucBuf[7] = (ucTemp % 10) | '0';
	ucBuf[8]= 0x00;
	
	memcpy(&ucBuf[0], "ERROR", 5);
				
#ifdef  ST7565P
	ST7565_UpdateDisplayData(7, ucBuf[0]);
	ST7565_UpdateDisplayData(16, ucBuf[1]);
	ST7565_UpdateDisplayData(25, ucBuf[2]);
	ST7565_UpdateDisplayData(34, ucBuf[3]);
	ST7565_UpdateDisplayData(44, ucBuf[4]);
	ST7565_UpdateDisplayString(58, &ucBuf[6], 0);
#endif

}

#if 0
void CD_DISP_Display_Eject(void)
{
	unsigned char ucBuf[5];
	memcpy(&ucBuf[0], "EJECT", 5);
			
	#ifdef  ST7565P
	ST7565_UpdateDisplayData(7, ucBuf[0]);
	ST7565_UpdateDisplayData(16, ucBuf[1]);
	ST7565_UpdateDisplayData(23, ucBuf[2]);
	ST7565_UpdateDisplayData(32, ucBuf[3]);
	ST7565_UpdateDisplayData(41, ucBuf[4]);
	#endif                       
}                              
#endif

void CD_DISP_FileCheck(void)
{
	unsigned char ucBuf[10];
	memcpy(&ucBuf[0], "FILE CHECK", 10);
		
	#ifdef  ST7565P
	ST7565_UpdateDisplayData(4, ucBuf[0]);
	ST7565_UpdateDisplayData(12, ucBuf[1]);
	ST7565_UpdateDisplayData(15, ucBuf[2]);
	ST7565_UpdateDisplayData(23, ucBuf[3]);
	ST7565_UpdateDisplayData(37, ucBuf[5]);
	ST7565_UpdateDisplayData(46, ucBuf[6]);
	ST7565_UpdateDisplayData(55, ucBuf[7]);
	ST7565_UpdateDisplayData(64, ucBuf[8]);
	ST7565_UpdateDisplayData(73, ucBuf[9]);
	#endif

	//LOG_LC786("CD_DISP_FileCheck:%X",LC786XXX_GetMediaStatus(FUNC_CD));

}

void CD_DISP_Loading(void)
{
	unsigned char ucBuf[7];
	memcpy(&ucBuf[0], "LOADING", 7);
			
	#ifdef  ST7565P
	ST7565_UpdateDisplayData(7, ucBuf[0]);
	ST7565_UpdateDisplayData(15, ucBuf[1]);
	ST7565_UpdateDisplayData(25, ucBuf[2]);
	ST7565_UpdateDisplayData(36, ucBuf[3]);
	ST7565_UpdateDisplayData(45, ucBuf[4]);
	ST7565_UpdateDisplayData(48, ucBuf[5]);
	ST7565_UpdateDisplayData(57, ucBuf[6]);
	#endif

}

void CD_DISP_Display_NoInfo(void)
{
	unsigned char ucBuf[7];
	memcpy(&ucBuf[0], "NO INFO", 7);
			
	#ifdef  ST7565P
	ST7565_UpdateDisplayData(14, ucBuf[0]);
	ST7565_UpdateDisplayData(23, ucBuf[1]);
	ST7565_UpdateDisplayData(38, ucBuf[3]);
	ST7565_UpdateDisplayData(41, ucBuf[4]);
	ST7565_UpdateDisplayData(50, ucBuf[5]);
	ST7565_UpdateDisplayData(58, ucBuf[6]);
	#endif
}
void CD_Disp_Display_FFREW(void)
{
	unsigned char ucBuf[6];
	memset(&ucBuf[0], 0x00, 6);

	ucBuf[0] = (sCD_PlayInfo.Min / 10) + '0';
	ucBuf[1] = (sCD_PlayInfo.Min % 10) + '0';
	
	ucBuf[2] = ':';

	ucBuf[3] = (sCD_PlayInfo.Sec / 10) + '0';
	ucBuf[4] = (sCD_PlayInfo.Sec % 10) + '0';
	ucBuf[5] = 0x00;
	
	#ifdef  ST7565P
	ST7565_UpdateDisplayString(0,&ucBuf[0], 0);
	#endif
}

void CD_DISP_CDDATrackNumber(void)
{
	unsigned char ucBuf[10];
	unsigned short usNumber = 0;	
	
	memset(&ucBuf[0], ' ', 10);

	ucBuf[0] = 'T';
	ucBuf[1] = 'r';
	ucBuf[2] = 'a';
	ucBuf[3] = 'c';
	ucBuf[4] = 'k';
	
	usNumber = sCD_PlayInfo.FileNo; 
	ucBuf[7] = (usNumber / 10) + '0';
	ucBuf[8] = (usNumber % 10) + '0';
	ucBuf[9] = 0x00;
	
	#ifdef  ST7565P
	ST7565_UpdateDisplayString(7, &ucBuf[0], 0);
//	ST7565_UpdateDisplayString(58, &ucBuf[7], 0);
	#endif	
///////
#ifdef	DEBUG_UART
	if  (sCD_PlayInfo.FileNo == 0)
	{
		LOG_LC786("CD_DISP_CDDATrackNumber:%X",LC786XXX_GetMediaStatus(FUNC_CD));
	}
#endif
	
}

void CD_DISP_CDDAPlayTime(void)
{
	unsigned char ucBuf[10];
	unsigned short usNumber = 0;	

	memset(&ucBuf[0], 0x00, 10);
	
	usNumber = sCD_PlayInfo.FileNo; 
	ucBuf[0] = 'T';
	ucBuf[1] = (usNumber / 10) + '0';
	ucBuf[2] = (usNumber % 10) + '0';

	ucBuf[3] = ' ';
	ucBuf[4] = (sCD_PlayInfo.Min / 10) + '0';
	ucBuf[5] = (sCD_PlayInfo.Min % 10) + '0';
	ucBuf[6] = ':';

	ucBuf[7] = (sCD_PlayInfo.Sec / 10) + '0';
	ucBuf[8] = (sCD_PlayInfo.Sec % 10) + '0';
	ucBuf[9] = 0x00;
	
	#ifdef  ST7565P
	ST7565_UpdateDisplayString(7, &ucBuf[0], 0);
	#endif	

#ifdef	DEBUG_UART
	if  (sCD_PlayInfo.FileNo == 0)
	{
		LOG_LC786("CD_DISP_CDDAPlayTime:%X",LC786XXX_GetMediaStatus(FUNC_CD));
	}
#endif

}

void CD_DISP_CDROMPlayTime(void)
{
	unsigned char ucBuf[11];
	unsigned short usNumber = 0;	

	memset(&ucBuf[0], 0x00, 11);

	usNumber = sCD_PlayInfo.FileNo;	
	ucBuf[0] = 'T';
	ucBuf[1] = (usNumber / 100) + '0';	
	usNumber = (usNumber % 100);
	ucBuf[2] = (usNumber / 10) + '0';	
	usNumber = usNumber % 10;
	ucBuf[3] = usNumber + '0';

	ucBuf[4] = ' ';
	ucBuf[5] = (sCD_PlayInfo.Min / 10) + '0';
	ucBuf[6] = (sCD_PlayInfo.Min % 10) + '0';
	ucBuf[7] = ':';

	ucBuf[8] = (sCD_PlayInfo.Sec / 10) + '0';
	ucBuf[9] = (sCD_PlayInfo.Sec % 10) + '0';
	ucBuf[10] = 0x00;

	#ifdef  ST7565P
	ST7565_UpdateDisplayString(7, &ucBuf[0], 0);
	#endif	

	#ifdef  DEBUG_UART
	if  (sCD_PlayInfo.FileNo == 0)
	{
		LOG_LC786("CD_DISP_CDROMPlayTime:%X",LC786XXX_GetMediaStatus(FUNC_CD));
	}
	#endif
}

#ifdef  FILE_SEARCH

extern unsigned short usCD_FileSearchNumber;

void CD_DISP_CDDA_FileSearch(void)
{
	unsigned char ucBuf[10];
	unsigned short usNumber = 0;	
	
	memset(&ucBuf[0], ' ', 10);

	ucBuf[0] = 'T';
	ucBuf[1] = 'r';
	ucBuf[2] = 'a';
	ucBuf[3] = 'c';
	ucBuf[4] = 'k';
	
	usNumber = usCD_FileSearchNumber; 
	ucBuf[7] = (usNumber / 10) + '0';
	ucBuf[8] = (usNumber % 10) + '0';
	ucBuf[9] = 0x00;
	
	#ifdef  ST7565P
	ST7565_UpdateDisplayString(7, &ucBuf[0], 0);
//	ST7565_UpdateDisplayString(58, &ucBuf[7], 0);
	#endif	
///////
}

unsigned char CD_DISP_FileSearch(void)
{
	unsigned char ucRet = 1;
	
	if  (ucLC786XXX_CurrentMediaID == LC786X_CDDA)
	{
		CD_DISP_CDDA_FileSearch();
		
		if  (usDISP_TempDispMode_Timer50msec == 0)
		{
			DISP_ClearTempDisplayMode();
			DISP_PageScrollReset();
		}
		return(0);
	}
	
	if  (DISP_PageScroll(1, INFO_FILENAME, &ucCD_FileSearchName[0], MEDIA_CHAR_SIZE, ucCD_FileSearchName_CharCode) == 1)
	{
		ucRet = 0;		
	}

	if  (ucRet == 0)
	{
		DISP_ClearTempDisplayMode();
		DISP_PageScrollReset();
	}
	
	if  (ucDISP_ScrollEnable == 0)
	{
		if  (ucDISP_FolderName_Timer50msec == 0)
		{
			ucDISP_FolderName = 0;
		}
	}
	return(ucRet);
}
#endif

unsigned char CD_DISP_FileName(void)
{
	unsigned char ucRet = 1;

	if  (!CD_GetTextStatus(UI_TEXT_READY_FILENAME))
	{
		return(1);
	}
	
	if  (DISP_PageScroll(ucDISP_FileName, INFO_FILENAME, &ucCD_FileName[0], MEDIA_CHAR_SIZE, ucCD_FileName_CharCode) == 1)
	{
		ucDISP_FileName = 0;
		DISP_PageScrollReset();
		ucRet = 0;
	}
	if  (ucDISP_ScrollEnable == 0)
	{
		if  (ucDISP_FileName_Timer50msec == 0)
		{
			ucDISP_FileName = 0;
		}
	}
	
	return(ucRet);
}

unsigned char CD_DISP_FolderName(void)
{
	unsigned char ucRet = 1;
	
	if  (!CD_GetTextStatus(UI_TEXT_READY_FOLDERNAME))
	{
		return(1);
	}
	
	if  (DISP_PageScroll(ucDISP_FolderName, INFO_FOLDERNAME, &ucCD_FolderName[0], MEDIA_CHAR_SIZE, ucCD_FolderName_CharCode) == 1)
	{
		ucDISP_FolderName = 0;
		DISP_PageScrollReset();
		ucRet = 0;
	}
	if  (ucDISP_ScrollEnable == 0)
	{
		if  (ucDISP_FolderName_Timer50msec == 0)
		{
			ucDISP_FolderName = 0;
		}
	}

	return(ucRet);
}

void CD_DISP_ID3Tag(void)
{
	unsigned char ucBuf[16];
	unsigned short usBitrate = 0;
	unsigned char ucSize;
	
	memset(&ucBuf[0], 0x00, 16);
		
	switch  (ucCD_Display_ID3Tag)
	{
		case ID3TAG_ARTIST:
			if  (CD_GetTextStatus(UI_TEXT_READY_ARTIST))
			{
				ucSize = DISP_BufferNull(&ucCD_ID3_Artist[0], MEDIA_CHAR_SIZE);
				if  (ucSize == 0)
				{
					memcpy(&ucBuf[0], "No Artist", 9);
					DISP_PageScroll(0, INFO_ID3TAG, &ucBuf[0], 9, 0);
				}
				else
				{
					DISP_PageScroll(0, INFO_ID3TAG, &ucCD_ID3_Artist[0], ucSize, ucCD_ID3_Artist_CharCode);
				}
			}
			else
			{
				CD_DISP_Display_NoInfo();
			}
			break;
		case ID3TAG_TITLE:
			if  (CD_GetTextStatus(UI_TEXT_READY_TITLE))
			{
				ucSize = DISP_BufferNull(&ucCD_ID3_Title[0], MEDIA_CHAR_SIZE);
				if  (ucSize == 0)
				{
					memcpy(&ucBuf[0], "No Title", 8);
					DISP_PageScroll(0, INFO_ID3TAG, &ucBuf[0], 8, 0);
				}
				else
				{
					DISP_PageScroll(0, INFO_ID3TAG, &ucCD_ID3_Title[0], ucSize, ucCD_ID3_Title_CharCode);
				}
			}
			else
			{
				CD_DISP_Display_NoInfo();
			}
			break;
		case ID3TAG_ALBUM:
			if  (CD_GetTextStatus(UI_TEXT_READY_ALBUM))
			{
				ucSize = DISP_BufferNull(&ucCD_ID3_Album[0], MEDIA_CHAR_SIZE);
				if  (ucSize == 0)
				{
					memcpy(&ucBuf[0], "No Album", 8);
					DISP_PageScroll(0, INFO_ID3TAG, &ucBuf[0], 8, 0);
				}
				else
				{
					DISP_PageScroll(0, INFO_ID3TAG, &ucCD_ID3_Album[0], ucSize, ucCD_ID3_Album_CharCode);
				}
			}
			else
			{
				CD_DISP_Display_NoInfo();
			}
			break;
		case ID3TAG_BITRATE:
			if  (CD_GetTextStatus(UI_TEXT_READY_BITRATE))
			{
				usBitrate = sCD_PlayInfo.BitRate;
				ucBuf[0] = (usBitrate / 100) + '0';
				usBitrate = (usBitrate % 100);
				ucBuf[1] = (usBitrate / 10) + '0';
				usBitrate = usBitrate % 10;
				ucBuf[2] = usBitrate + '0';
				ucBuf[3] = ' ';
				ucBuf[4] = 'k';
				ucBuf[5] = 'b';
				ucBuf[6] = 'p';
				ucBuf[7] = 's';
				ucBuf[8] = 0x00;				
			#ifdef  ST7565P
				ST7565_UpdateDisplayString(7, &ucBuf[0], 0);	
			#else
				memcpy(&ucDISP_Buf[3], &ucBuf[0], 8);
			#endif
			}
			else
			{
				CD_DISP_Display_NoInfo();
			}
	}
}

void CD_DISP_CDText(void)
{
	unsigned char ucBuf[8];
	
	memset(&ucBuf[0], ' ', 8);
		
	switch  (ucCD_Display_CD_Text)
	{
		case CD_TEXT_ALBUM:
			if  (CD_GetTextStatus(UI_TEXT_READY_ALBUM))
			{
				DISP_PageScroll(0, CD_TEXT_ALBUM, &ucCD_ID3_Album[0], MEDIA_CHAR_SIZE, ucCD_ID3_Album_CharCode);
			}
			else
			{
				CD_DISP_CDDATrackNumber();
			}
			break;
		case CD_TEXT_ALBUM_ARTIST:
			if  (CD_GetTextStatus(UI_TEXT_READY_ALBUMARTIST))
			{
				DISP_PageScroll(0, CD_TEXT_ALBUM, &ucCD_ID3_AlbumArtist[0], MEDIA_CHAR_SIZE, ucCD_ID3_AlbumArtist_CharCode);
			}
			else
			{
				CD_DISP_CDDATrackNumber();
			}
			break;
		case CD_TEXT_TITLE:
			if  (CD_GetTextStatus(UI_TEXT_READY_TITLE))
			{
				DISP_PageScroll(0, CD_TEXT_ALBUM, &ucCD_ID3_Title[0], MEDIA_CHAR_SIZE, ucCD_ID3_Title_CharCode);
			}
			else
			{
				CD_DISP_CDDATrackNumber();
			}
			break;
		case CD_TEXT_ARTIST:
			if  (CD_GetTextStatus(UI_TEXT_READY_ARTIST))
			{
				DISP_PageScroll(0, CD_TEXT_ALBUM, &ucCD_ID3_Artist[0], MEDIA_CHAR_SIZE, ucCD_ID3_Artist_CharCode);
			}
			else
			{
				CD_DISP_CDDATrackNumber();
			}
	}
}

void CD_DISP_SubText(void)
{
	unsigned char ucBuf[3];
	
	memcpy(&ucBuf[0], "CD ", 3);
	
#ifdef  ST7565P
	ST7565_UpdateSubDisplayData(&ucBuf[0]);	
#endif

}

void CD_DISP_MainText(void)
{
#ifdef  MIC
	if	(MIC_GetMicStatus() == MIC_ON)
	{
		if  ((ucCD_Pause == 0) && (LC786XXX_GetMediaStatus(FUNC_CD) != LC786X_MS_PAUSE))
		{
			MIC_DISP_MainText();
			return;
		}
	}
#endif
	if  ((ucDECK_Mode == DECK_MODE_LOAD) && (ucDECK_User_Loading == 1))
	{
		CD_DISP_Loading();
		return;
	}
	if  (ucLC786XXX_InitializeComplete == 0)
	{
		CD_DISP_FileCheck();
		return;
	}
	if  (ucDECK_Mode == DECK_MODE_ERROR)
	{
		CD_DISP_CDError01();
		return;
	}
	
	if	(ucLC786XXX_ErrorSeq != 0)
	{
		DISP_ErrorCode();
		return;
	}
	
	switch  (ucCD_Status)
	{
		case CD_STATUS_NONE:
		case CD_STATUS_LOADED:
		case CD_STATUS_LOADING:
		case CD_STATUS_READING:
			CD_DISP_FileCheck();
			break;
		case CD_STATUS_MOUNTED:
			if  ((ucCD_Pause == 1) || (LC786XXX_GetMediaStatus(FUNC_CD) == LC786X_MS_PAUSE))
			{
				CD_DISP_Pause();
				return;
			}
			if  (ucCD_FastPlay == MEDIA_NORMAL_PLAY)
			{
				if  (ucCD_CurrentPlayDiscType == CD_DISC_CDROM) 
				{
					if  (ucDISP_FolderName == 1)
					{
						if  (CD_DISP_FolderName() == 1)
						{
							return;
						}
					}	
					if  (ucDISP_FileName == 1)
					{
						if  (CD_DISP_FileName() == 1)
						{
							return;
						}
					}
				}
				if  (ucCD_CurrentPlayDiscType == CD_DISC_CDDA) 
				{
					if  (ucDISP_FileName == 1)
					{
						CD_DISP_CDDATrackNumber();
						if  (ucDISP_FileName_Timer50msec == 0)
						{
							ucDISP_FileName = 0;
						}
						return;
					}
				}
		
				if  ((ucDISP_ClockMode == 1) && (ucDISP_CurrentDisplay_Timer50msec == 0))
				{
					DISP_MainText_Clock();
					return;
				}
				switch  (ucCD_Display_Info)
				{
					case INFO_FILENAME:
						if  (ucCD_CurrentPlayDiscType == CD_DISC_CDDA) 
						{
							CD_DISP_CDText();
						}
						else
						{
							CD_DISP_FileName();
						}	
						break;
					case INFO_PLAYTIME:
						if  (ucCD_CurrentPlayDiscType == CD_DISC_CDDA) 
						{
							CD_DISP_CDDAPlayTime();
						}
						else
						{
							CD_DISP_CDROMPlayTime();
						}
						break;
					case INFO_FOLDERNAME:
						CD_DISP_FolderName();
						break;
					case INFO_ID3TAG:
						CD_DISP_ID3Tag();
						break;
				}
			}
			else
			{
				if  (ucCD_CurrentPlayDiscType == CD_DISC_CDDA)
				{
					CD_DISP_CDDAPlayTime();
				}
				else
				{
					CD_DISP_CDROMPlayTime();
				}
			}
			break;
		case CD_STATUS_NOFILE:
			break;
	}	
}

#endif
